package com.koron.css2.baseConfig.mapper;

import com.koron.css2.baseConfig.bean.BaseReceiptAccessoryBean;
import com.koron.css2.baseConfig.queryBean.BaseReceiptAccessoryQueryBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BaseReceiptAccessoryMapper {

	/**
	 * 通过单据主键ID以及附件类型编号查询出有多少个附件
	 * @param receiptId 单据主键ID
	 * @param accessoryNo 附件类型编号
	 * @return
	 */
	int countByReceiptId(@Param("receiptId") String receiptId, @Param("accessoryNo") String accessoryNo);
	
	List<BaseReceiptAccessoryBean> selectList(BaseReceiptAccessoryQueryBean query);
	
	List<BaseReceiptAccessoryBean> selectListByCtmNo(BaseReceiptAccessoryQueryBean query);
	
	BaseReceiptAccessoryBean selectById(String id);
	
	int insert(BaseReceiptAccessoryBean bean);
	
	int deleteById(String id);
	
	void updateAccessoryReceiptId(@Param("id") String id,@Param("tempId") String tempId);
	
	int selectReceiptByUserNo(BaseReceiptAccessoryQueryBean query);
	
	int isHaveUserNo(String receiptType);
	int deleteByAccessoryNo(BaseReceiptAccessoryBean bean);
}	
